//1
import axios from 'axios'


//2自定义axios
const server = axios.create({
    baseURL: '',
    timeout: 5000
})


//3请求拦截
server.interceptors.request.use(config => {
    return config
}, err => {
    Promise.reject(err)
})


//4响应拦截
server.interceptors.response.use(res => {
    return res
}, err => {
    // 错误码判断逻辑
    Promise.reject(err)
})


//5导出自定义的axios
export default server